FROM openjdk:21-slim

# 安装ca-certificates包
# RUN apt-get update && apt-get install -y ca-certificates

# 确保Java运行时使用正确的CA证书文件
# RUN keytool -importkeystore -srckeystore /etc/ssl/certs/java/cacerts -destkeystore /etc/ssl/certs/java/cacerts -srcstoretype jks -deststoretype jks -noprompt -storepass changeit -deststorepass changeit || true

# 设置维护者信息
LABEL maintainer="chz"

RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
    && echo "Asia/Shanghai" > /etc/timezone
ADD *.jar app.jar
EXPOSE 12582
ENTRYPOINT ["java","-Dspring.profiles.active=prod","-jar","/app.jar"]
